package com.ct.boot.launch.dao.testdb;

import com.fasterxml.jackson.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * @Auther: 1
 * @Date: 2020/6/11 18:11
 * @Description:
 */

@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonPropertyOrder(value = {"createdTime", "id"})
@Entity
@Table(name = "article")
public class Article {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @Column(nullable=false,length = 32)
    private String author;
    @Column(nullable = false,length = 32,unique = true)
    private String title;
    @Column(length = 512)
    private String content;
    @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "Time")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Date createdTime;
}
